package com.hcloud.libupload.utils

import android.util.Base64
import java.io.UnsupportedEncodingException
import java.net.URLEncoder

object UploadUtils {

    fun getUploadAuth(loginKey: String, phone: String, boxId: String): String {
        val pwd = "$loginKey,$phone"
        val user = "$boxId:$pwd".toByteArray()
        return "Basic " + Base64.encodeToString(user, Base64.NO_WRAP)
    }


    fun getRequestId(phone: String = ""): String {
        return "$phone${System.currentTimeMillis()}${(0..9).random()}00000${(0..9).random()}"
    }
}